<template>
	<!-- 权益 -->
	<view class="nft_equity">
		<!-- 顶部权限详情信息 -->
		<view class="top_info">
			<!-- 左侧封面 -->
			<view class="cover">
				<image src="../../static/img/logo.png" mode=""></image>
			</view>
			<!-- 右侧内容 -->
			<view class="right">
				<view class="conent">
					<view class="title">
						修勾碎片-1号
					</view>
					<view class="money">
						价格:2000hs
					</view>
				</view>
				<!-- 按钮 -->
				<!-- 已拥有 -->
				<view class="btn" v-if="ishave === true">
					<view class="btn_sell">
						<u-button text="出售" color="var(--echo-main-color)" @tap="sell" size="mini"></u-button>
					</view>
					<view class="">
						<u-button text="转让" color="var(--echo-main-color)" @tap="transfer" size="mini"></u-button>
					</view>
				</view>
				<!-- 未拥有 -->
				<view class="btn" v-if="ishave === false">
					<u-button text="购买" color="var(--echo-main-color)" @tap="buy" size="mini"></u-button>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				buyNum: 1
			}
		},
		props: {
			ishave: {
				type: Boolean
			},
		},
		methods: {
			// 转让
			transfer() {
				this.$emit("transfer")
			},
			// 出售
			sell() {
				this.$emit("sell")
			},
			// 购买
			buy(){
				this.$emit("buy")
			}
		}
	}
</script>
<style lang="scss">
	.nft_equity {

		width: 94%;
		margin: 0 auto;
		margin-top: 40rpx;

		// 上面展示信息
		.top_info {
			display: flex;
			justify-content: space-between;
			padding: 20rpx;

			// 左侧封面图
			.cover {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
				overflow: hidden;

				image {
					width: 100%;
					height: 100%;
				}
			}

			// 右侧内容区域
			.right {
				padding: 8rpx 30rpx;
				flex-grow: 1;
				font-size: 28rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.money {
					margin-top: 8rpx;
					color: #999;
				}

				.btn {
					display: flex;
					justify-content: space-between;

					&_sell {
						margin-right: 16rpx;
					}
				}
			}
		}
	}
</style>
